package com.huahua.myIdea.util;

import com.huahua.myIdea.service.IBaseService;
import com.huahua.myIdea.service.serviceImpl.KafkaServiceImpl;
import com.huahua.myIdea.service.serviceImpl.MQServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 根据不同配置文件，选择发送消息工具类
 */
@Component
public class SendMessageUtil {
    //message.type在application.yaml，":kafka" 设置默认值为kafka
    /*
    @Value("${message.type:kafka}")
    private String type;

    @Autowired
    KafkaServiceImpl kafkaService;
    @Autowired
    MQServiceImpl mqService;

    public IBaseService get(){
        if (type.equals("kafka"))
            return kafkaService;
        else
            return mqService;
    }
    */
}